package com.bjqg.bjqg01.bjqg.appli;

import android.app.Activity;
import android.app.Application;
import android.content.Context;

import com.bjqg.bjqg01.bjqg.activity.longrange.utils.ContentBeanDaoManager;
import com.bjqg.bjqg01.bjqg.activity.longrange.utils.CydwBeanManager;
import com.bjqg.bjqg01.bjqg.activity.longrange.utils.CyrBeanManager;
import com.bjqg.bjqg01.bjqg.activity.longrange.utils.GcmcBeanManager;
import com.bjqg.bjqg01.bjqg.activity.longrange.utils.JzdwBeanManager;
import com.bjqg.bjqg01.bjqg.activity.longrange.utils.JzrBeanManager;
import com.bjqg.bjqg01.bjqg.activity.longrange.utils.SbBeanManager;
import com.bjqg.bjqg01.bjqg.activity.longrange.utils.SccjBeanManager;
import com.bjqg.bjqg01.bjqg.activity.longrange.utils.SgbwBeanManager;
import com.bjqg.bjqg01.bjqg.activity.longrange.utils.WtdwBeanManager;
import com.bjqg.bjqg01.bjqg.activity.longrange.utils.WtrBeanManager;
import com.bjqg.bjqg01.bjqg.activity.longrange.utils.WtrPhoneBeanManager;
import com.lzy.okgo.OkGo;
import com.tencent.bugly.crashreport.CrashReport;

import java.util.ArrayList;

/**
 * Created by Administrator on 2018/1/9.
 */

public class MyApplication extends Application {

    private static Context mContext;
    private ArrayList<Activity> list;

    @Override
    public void onCreate() {
        super.onCreate();
        mContext = getApplicationContext();
        OkGo.getInstance().init(this);
        list = new ArrayList<>();
        CrashReport.initCrashReport(getApplicationContext(), "12f7ab50c6", false);
        ContentBeanDaoManager.getInstance();
        WtdwBeanManager.getInstance();
        SccjBeanManager.getInstance();
        WtrBeanManager.getInstance();
        WtrPhoneBeanManager.getInstance();
        GcmcBeanManager.getInstance();
        SgbwBeanManager.getInstance();
        CydwBeanManager.getInstance();
        CyrBeanManager.getInstance();
        JzdwBeanManager.getInstance();
        JzrBeanManager.getInstance();
        SbBeanManager.getInstance();

    }

    public void AddActivity(Activity activity) {

        list.add(activity);

    }


    public static Context getContext() {
        return mContext;
    }

    public void exit() {
        try {
            for (Activity activity : list) {
                if (activity != null)
                    activity.finish();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }


}
